package com.zk5_education.service_edu.controller;


import com.zk5_education.R;
import com.zk5_education.service_edu.entity.subject.OneSubject;
import com.zk5_education.service_edu.service.EduSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-08-07
 */
@RestController
@RequestMapping("/service_edu/edu_subject")
@CrossOrigin
public class EduSubjectController {

    @Autowired
    EduSubjectService eduSubjectService;

    @PostMapping("/addSubject")
    public R addSubject(MultipartFile file){

        eduSubjectService.addsubject(file,eduSubjectService);
        return R.success();
    }

    @GetMapping("/findAllsubject")
    public R findAllSubject(){
        List<OneSubject> list=eduSubjectService.findAllsubject();

        return R.success().data("list",list);
    }


}

